//
//  lookingForSubsidiesTableViewCell.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/7.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "lookingForSubsidiesTableViewCell.h"

@implementation lookingForSubsidiesTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
//        [self hiderLine:NO];
        [self setSepartionLineWith:lineModel_Half];
        GLGWLabel *lab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(12) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self.contentView];
        [lab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(kWidthProportion_In_iPhoneTriploid(17));
            make.top.equalTo(self.contentView.mas_top).offset(kHeightProportion_In_iPhoneTriploid(12));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(17)));
        }];
        lab.text = @"备注";
        
        GLGWLabel *deLab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(12) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self.contentView];
        [deLab mas_updateConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(lab.mas_left);
            make.top.equalTo(self.contentView.mas_top).offset(kHeightProportion_In_iPhoneTriploid(35));
            make.right.equalTo(self.contentView.mas_right).offset(-kWidthProportion_In_iPhoneTriploid(48));
            make.bottom.equalTo(@(-kHeightProportion_In_iPhoneTriploid(14)));
        }];
        deLab.numberOfLines = 0;
        NSString *str = @"订单提成金额(￥100.00) - 个人所得税(￥10.00) - 开票税(￥10.00) - 服务费(￥10.00)  = 实际佣金收入(￥70.00)";
        
        NSMutableAttributedString *att = [[NSMutableAttributedString alloc] initWithString:str];
        NSRange ran1 = [str rangeOfString:@"(￥100.00)"];
        NSDictionary *dic1 = [NSDictionary dictionaryWithObjectsAndKeys:SYSTEMFONT(12),NSFontAttributeName,[UIColor colorWithHexString:@"#EC5353"],NSForegroundColorAttributeName,nil];
        [att addAttributes:dic1 range:ran1];
        
        NSRange ran2 = [str rangeOfString:@"(￥10.00)"];
        [att addAttributes:dic1 range:ran2];
        
        NSRange ran3 = [str rangeOfString:@"开票税"];
        NSRange ran33 = NSMakeRange(ran3.location + ran3.length, ran2.length);
        [att addAttributes:dic1 range:ran33];
        
        NSRange ran4 = [str rangeOfString:@"服务费"];
        NSRange ran44 = NSMakeRange(ran4.location + ran4.length, ran2.length);
        [att addAttributes:dic1 range:ran44];
        
        NSRange ran5 = [str rangeOfString:@"(￥70.00)"];
        [att addAttributes:dic1 range:ran5];
        
        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
        [paragraphStyle setLineSpacing:5];
        [att addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [str length])];
        deLab.attributedText = att;
    }
    return self;
}

@end
